package com.cl.security.core.entity;

import com.cl.security.base.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Set;

@Entity
@Table(name = "mall_property")
@Getter
@Setter
@SQLDelete(sql = "update mall_property set deleted=1 where id=?")
@Where(clause = "deleted<>1")
public class Property extends BaseEntity {
    @ManyToOne
    @JsonIgnoreProperties({"products","properties","children","parent"})
    @JoinColumn(name = "category_id",insertable = false,updatable = false)
    private Category category;

    @Column(name = "category_id")
    private Long categoryId;
}
